<template>
  <div class="app">
    <header>
      <div class="header">
        <div class="header-left">
          <div class="name">驾考通</div>
          <router-link to="/city">
            <div class="city">
              {{city}}
              <div class="down"></div>
            </div>
          </router-link>
        </div>
        <div class="header-right">
          <router-link :to="{path:'/message',query:{city:city,id:id}}">
            <img src="../assets/xiaoxi.png" alt />
          </router-link>
        </div>
      </div>

      <!--登录 -->

      <div class="login-box">
        <div class="login-left">
          <img src="../assets/user.png" alt />
        </div>
        <div class="login-mid">
          <button class="btn" @click="login">立即登录</button>
          <p>提高正确率，同步答题数据</p>
        </div>
        <div class="login-right">
          <router-link to="/vip">
        <span>VIP专属</span>
        </router-link>
          
        </div>
      </div>
    </header>
    
    <div class="kemu">
      <van-tabs
        v-model="active"
        sticky
        offset-top="160px"
        title-active-color="#ff6363"
        line-height="2px"
        line-width="50px"
      >
        <van-tab title-class="my-tab" title="科一">
          <first-mid :cityId="id" :city="city"></first-mid>
        </van-tab>
        <van-tab title-class="my-tab" title="科二">
          <ke-er></ke-er>
        </van-tab>
        <van-tab title-class="my-tab" title="科三">
          <ke-san></ke-san>
        </van-tab>
        <van-tab title-class="my-tab" title="科四">
          <ke-si></ke-si>
        </van-tab>
                

      </van-tabs>
    </div>

    <bottom></bottom>
  </div>
</template>

<script>
import Bottom from "../components/Bottom.vue";
import FirstMid from "../components/FirstMid.vue";
import KeEr from "../components/KeEr.vue";
import KeSan from "../components/KeSan.vue";
import KeSi from "../components/KeSi.vue";
export default {
  name: "Test",
  data() {
    return {
      subj: [
        { sub: "科一", id: "001" },
        { sub: "科二", id: "002" },
        { sub: "科三", id: "003" },
        { sub: "科四", id: "004" },
        { sub: "VIP课程", id: "005" }
      ],
      city:'广州市',
      active: 0,
      id:''
    };
  },
  mounted() {
    this.city = this.$route.query.city
    this.id = this.$route.query.id
  },
  methods: {
    login() {
      this.$router.push({path:"/login",query:{city:this.city,id:this.id}});
    }
  },
  components: { Bottom, FirstMid,KeEr,KeSan,KeSi },

};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style>
header {
  width: 100%;
  height: 80px;
  background-color: #4070ff;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}
header .header {
  line-height: 5rem;
  display: flex;
}

header .header .header-left {
  height: 80px;
  flex-basis: 90%;
  align-items: center;
  justify-content: center;
  display: flex;
  color: #fff;
}

header .header .header-left .name {
  font-size: 1.25rem;
}
header .header .header-left a {
  height: 100%;
  color: #fff;
}
header .header .header-left .city {
  width: 60px;
  height: 100%;
  font-size: 0.875rem;
  margin-left: 0.625rem;
  position: relative;
  overflow: hidden;
}

header .header .header-left .city .down {
  border-top: 0.3125rem solid #fff;
  border-left: 0.3125rem solid transparent;
  border-right: 0.3125rem solid transparent;
  position: absolute;
  top: 2.375rem;
  right: 5px;
}

header .header .header-right {
  flex-basis: 10%;
  height: 100%;
  line-height: 5rem;
  padding-right: 1.875rem;
}

header .header .header-right img {
  width: 30px;
  height: 30px;
  vertical-align: middle;
}

header .login-box {
  width: 100%;
  height: 80px;
  display: flex;
  background-color: #fff;
}

header .login-box .login-left {
  flex-basis: 80px;
  height: 80px;
  line-height: 80px;
  text-align: center;
}

header .login-box .login-left img {
  margin-left: 10px;
  width: 60px;
  height: 60px;
  vertical-align: middle;
}

header .login-box .login-mid {
  width: 80%;
  height: 80px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding-left: 0.3125rem;
}

header .login-box .login-mid .btn {
  color: #000;
  font-size: 1.25rem;
  border: 0;
  background-color: transparent;
}

header .login-box .login-mid p {
  color: #a0a0a0;
  font-size: 14px;
  margin-top: 0.625rem;
}

header .login-box .login-right {
  width: 40%;
  height: 100%;
  line-height: 80px;
  text-align: center;
}

header .login-box .login-right a {
    color: #fff;

}
header .login-box span {
  padding: 0.625rem 0.9375rem;
  background-color: #ff6363;
  border-radius: 3.125rem;
}

.kemu {
  width: 100%;
  position: absolute;
  top: 160px;
}
.my-tab {
  font-size: 18px !important;
}
</style>

